package myJs.tool

import japgolly.scalajs.react.callback.Callback

import scala.scalajs.js


object Pojo {

  trait SearchKind

  object TextSearch extends SearchKind

  object DateSearch extends SearchKind

  object NumericSearch extends SearchKind

  object DoubleSearch extends SearchKind

  object CheckboxSearch extends SearchKind

  trait SearchData

  case class TextSearchData(searchType: String, text: String) extends SearchData

  case class DateSearchData(startDate: String, endDate: String) extends SearchData

  case class NumericSearchData(min: String, max: String, kind: String) extends SearchData

  case class CheckboxSearchData(values: List[String]) extends SearchData

  case class SortData(field: String, order: String, kind: String)

  case class LeftItem(id: String, path: String, title: String, faClass: String)

  case class ImageData(id: String, url: String)
  case class ExportData(
      text: String,
      href: js.UndefOr[String] = js.undefined,
      onClick: js.UndefOr[(List[ujson.Obj], List[String]) => Callback] = js.undefined,
      disabled: Boolean = false
  )

  case class LiItem(
                     id: String,
                     href: String,
                     label: String
                   )

  case class NavItem(
                     id: String,
                     items: List[LiItem]
                   )

}
